import request from '@/utils/request'

// 获取字典类型
export function getAllDictType(): any {
  return request({
    url: '/dict/getAllDictType',
    method: 'get'
  })
}

// 获取字典码值
export function getDictsByType(dictType: any): any {
  return request({
    url: '/dict/getDictByType',
    method: 'get',
    params: dictType,
  })
}

// 保存字典
export function saveDict(data: any): any {
  return request({
    url: '/dict/saveDict',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'application/json',
    }
  })
}

// 保存字典
export function updateDict(data: any): any {
  return request({
    url: '/dict/updateDict',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'application/json',
    }
  })
}

// 刪除字典
export function deleteDict(data: any): any {
  return request({
    url: '/dict/deleteDict',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'application/json',
    }
  })
}
